// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';
const apiPrefix = '/web';

/** 新建租户信息 POST /sys/tenant/add */
export async function sysTenantControllerSave(
  body: API.SysTenantForm,
  options?: { [key: string]: any },
) {
  return request<API.ApiResultString>(`${apiPrefix}/sys/tenant/add`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 批量新建租户信息, 如果出现重复或保存失败则全部不保存 POST /sys/tenant/add/batch */
export async function sysTenantControllerSaveBatch(body: {}, options?: { [key: string]: any }) {
  return request<API.ApiResultString>(`${apiPrefix}/sys/tenant/add/batch`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除租户信息 DELETE /sys/tenant/del */
export async function sysTenantControllerDelete(body: number[], options?: { [key: string]: any }) {
  return request<API.ApiResultString>(`${apiPrefix}/sys/tenant/del`, {
    method: 'DELETE',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 修改租户信息 PUT /sys/tenant/edit */
export async function sysTenantControllerEdit(
  body: API.SysTenantUpdateForm,
  options?: { [key: string]: any },
) {
  return request<API.ApiResultString>(`${apiPrefix}/sys/tenant/edit`, {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 根据查询条件导出租户信息 GET /sys/tenant/export */
export async function sysTenantControllerExport(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.sysTenantControllerExportParams,
  options?: { [key: string]: any },
) {
  return request<any>(`${apiPrefix}/sys/tenant/export`, {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 分页获取租户信息 GET /sys/tenant/list */
export async function sysTenantControllerPageList(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.sysTenantControllerPageListParams,
  options?: { [key: string]: any },
) {
  return request<API.ApiResultPaginationSysTenant>(`${apiPrefix}/sys/tenant/list`, {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 为租户分配菜单 POST /sys/tenant/menu */
export async function sysTenantControllerEditMenus(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.sysTenantControllerEditMenusParams,
  body: API.SysTenantMenuForm,
  options?: { [key: string]: any },
) {
  return request<API.ApiResultString>(`${apiPrefix}/sys/tenant/menu`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    params: {
      ...params,
    },
    data: body,
    ...(options || {}),
  });
}

/** 搜索租户列表 GET /sys/tenant/search */
export async function sysTenantControllerSearch(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.sysTenantControllerSearchParams,
  options?: { [key: string]: any },
) {
  return request<API.ApiResultListSearchTenant>(`${apiPrefix}/sys/tenant/search`, {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 禁用/启用租户 PUT /sys/tenant/setStatus */
export async function sysTenantControllerSetStatus(
  body: API.SysTenantSetStatusForm,
  options?: { [key: string]: any },
) {
  return request<API.ApiResultString>(`${apiPrefix}/sys/tenant/setStatus`, {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
